package com.baidu.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class D02_InputStreamDemo1 {
    public static void main(String[] args) throws Exception {
        //1.创建字节输入流管道
        InputStream inputStream = new FileInputStream("src/003.txt");

        //2.读取一个字节
        int read = inputStream.read();
        System.out.println((char) read);
        int read2 = inputStream.read();
        System.out.println(read2);

        //3.循环读取
        int tmp;
        while ((tmp = inputStream.read()) != -1){
            System.out.println((char) tmp);
        }

        //3.读取多个字节
        byte[] bytes = {};
        int read1 = inputStream.read(bytes);
    }
}
